package com.jswlw.controller.api;

import com.jswlw.common.BaseApiResponse;
import com.jswlw.controller.api.req.aftersale.SaveBookInfoRequest;
import com.jswlw.controller.api.req.aftersale.SaveFeedBackRequest;
import com.jswlw.controller.api.req.aftersale.SaveRepairInfoRequest;
import com.jswlw.controller.api.wrapper.AfterSaleWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 吴维斌 E-mail:wuweibin0817@163.com
 * @version 创建时间：${date} ${time}
 */
@Api(tags = "售后")
@RestController
@RequestMapping("/api/afterSale")
public class ApiAfterSaleController {

    @Autowired
    AfterSaleWrapper wrapper;

    @ApiOperation(value = "新增报修信息", notes = "新增报修信息")
    @ApiResponse(code = 200, message = "OK", response = BaseApiResponse.class)
    @PostMapping("saveRepairInfo")
    public BaseApiResponse saveRepairInfo(@RequestBody SaveRepairInfoRequest request) {
        return wrapper.saveRepairInfo(request);
    }

    @ApiOperation(value = "新增反馈信息", notes = "新增反馈信息")
    @ApiResponse(code = 200, message = "OK", response = BaseApiResponse.class)
    @PostMapping("saveFeedBack")
    public BaseApiResponse saveFeedBack(@RequestBody SaveFeedBackRequest request) {
        return wrapper.saveFeedBack(request);
    }

    @ApiOperation(value = "新增预约安装", notes = "新增预约安装")
    @ApiResponse(code = 200, message = "OK", response = BaseApiResponse.class)
    @PostMapping("saveBookInfo")
    public BaseApiResponse saveBookInfo(@RequestBody SaveBookInfoRequest request) {
        return wrapper.saveBookInfo(request);
    }
}
